package cn.wolfcode.feign;

import cn.wolfcode.common.web.Result;
import cn.wolfcode.domain.PayVo;
import cn.wolfcode.domain.RefundVo;
import cn.wolfcode.feign.facback.AlipayFeignApiFeignback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@FeignClient(name = "pay-service", fallback = AlipayFeignApiFeignback.class)
public interface AlipayFeignApi {
    @RequestMapping("/alipay/payOnline")
    Result<String> payOnline(@RequestBody PayVo payVo);
    //在Fegin中，当传回的参数为对象以及map的时候，用RequestBody接受
    //当传回为一个基本数据类型RequestParam修饰


    @RequestMapping("/alipay/checkSign")
    Result<Boolean> checkSign(@RequestBody Map<String, String> params);

    @RequestMapping("/alipay/refundOnline")
    Result<Boolean> refundOnline(@RequestBody RefundVo refundVo);

}
